<?php

use \backend\models\Admin;

$this->addJsFile([
    "/static/js/app.js",
    "/static/plugins/notifyjs/dist/notify.min.js",
    "/static/plugins/notifications/notify-metro.js"
]);
$this->inline("title","修改我的头像");
?>
<div class="row">
    <div class="col-lg-6">
        <div class="card-box">
            <h4 class="m-t-0 header-title"><b>修改我的头像</b></h4>

            <form class="form-horizontal" action="" method="post">
                <input type="hidden" name="<?=Yii::$app->request->csrfParam?>" value="<?=Yii::$app->request->csrfToken?>">
                <div class="form-group">
                    <label for="old_password" class="col-sm-3 control-label">上传头像：</label>
                    <div class="col-sm-8">
                        <div class="fileupload btn btn-purple waves-effect waves-light">
                            <span><i class="ion-upload m-r-5"></i>点击上传</span>
                            <input onchange="app.uploadAvatar(this)" class="upload" type="file" id="file">
                            <input type="hidden" name="avatar" value="<?=Admin::getAvatar(false)?>">
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label for="old_password" class="col-sm-3 control-label">头像预览：</label>
                    <div class="col-sm-8">
                        <img style="width: 220px;height: 220px;border: 1px dashed rgba(0, 0, 0, 0.1);padding: 5px;" src="<?=Admin::getAvatar()?>" class="img-responsive avatar">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-3 col-sm-9">
                        <button type="submit" class="btn btn-primary waves-effect waves-light">
                            保存更改
                        </button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

